<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>跳转</title>
    <style>
       p{
           text-align: center;
       }
       span{
           color: red;
       }
    </style>
</head>
<body>
<h1 style="text-align: center">未登录，请先登录！</h1>
<p><span id="time">3</span>秒开始跳转</p>
<script>

    let cnt = 3;
    function f(){
        cnt--;
        if(cnt<=0){
            location.href = "index.jsp";
        }
        let t = document.getElementById("time");
        t.innerHTML = ""+cnt;
    }
    setInterval(f,1000);
</script>
</body>
</html>